Skip to content

Conversation

@ValorLin
Copy link

如下 html 代码

<script>console.log('yo')</script><script src="js/export.js?__inline=true"></script>

原有的正则表达式会匹配整行,而导致第一个 script 标签被错误地删除。
现在使用[^>]+?代替.+?保证只匹配>符号之前的内容。

@ValorLin
Copy link
Author

ValorLin commented Mar 3, 2015

@chyingp 求解决,因为我是先压缩 html 文件,再进行 grunt-inline 的。
这样会导致很多 <script> 标签在同一行中,由于这个 bug 的存在,正则表达式匹配错误会丢失一些内容。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant